home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / ppc-amigaos / include / powerup / ppcpragmas / misc_pragmas.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  2KB  |  66 lines

  1. /* Automatically generated header! Do not edit! */
  2.  
  3. #ifndef _PPCPRAGMA_MISC_H
  4. #define _PPCPRAGMA_MISC_H
  5. #ifdef __GNUC__
  6. #ifndef _PPCINLINE__MISC_H
  7. #include <powerup/ppcinline/misc.h>
  8. #endif
  9. #else
  10.  
  11. #ifndef POWERUP_PPCLIB_INTERFACE_H
  12. #include <powerup/ppclib/interface.h>
  13. #endif
  14.  
  15. #ifndef POWERUP_GCCLIB_PROTOS_H
  16. #include <powerup/gcclib/powerup_protos.h>
  17. #endif
  18.  
  19. #ifndef NO_PPCINLINE_STDARG
  20. #define NO_PPCINLINE_STDARG
  21. #endif/* SAS C PPC inlines */
  22.  
  23. #ifndef MISC_BASE_NAME
  24. #define MISC_BASE_NAME MiscBase
  25. #endif /* !MISC_BASE_NAME */
  26.  
  27. #define    AllocMiscResource(unitNum, name)    _AllocMiscResource(MISC_BASE_NAME, unitNum, name)
  28.  
  29. static __inline UBYTE *
  30. _AllocMiscResource(void *MiscBase, unsigned long unitNum, UBYTE *name)
  31. {
  32. struct Caos    MyCaos;
  33.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  34. //    MyCaos.M68kStart    =    NULL;
  35. //    MyCaos.M68kSize        =    0;
  36.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  37. //    MyCaos.PPCStart        =    NULL;
  38. //    MyCaos.PPCSize        =    0;
  39.     MyCaos.d0        =(ULONG) unitNum;
  40.     MyCaos.a1        =(ULONG) name;
  41.     MyCaos.caos_Un.Offset    =    (-6);
  42.     MyCaos.a6        =(ULONG) MiscBase;    
  43.     return((UBYTE *)PPCCallOS(&MyCaos));
  44. }
  45.  
  46. #define    FreeMiscResource(unitNum)    _FreeMiscResource(MISC_BASE_NAME, unitNum)
  47.  
  48. static __inline void
  49. _FreeMiscResource(void *MiscBase, unsigned long unitNum)
  50. {
  51. struct Caos    MyCaos;
  52.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  53. //    MyCaos.M68kStart    =    NULL;
  54. //    MyCaos.M68kSize        =    0;
  55.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  56. //    MyCaos.PPCStart        =    NULL;
  57. //    MyCaos.PPCSize        =    0;
  58.     MyCaos.d0        =(ULONG) unitNum;
  59.     MyCaos.caos_Un.Offset    =    (-12);
  60.     MyCaos.a6        =(ULONG) MiscBase;    
  61.     PPCCallOS(&MyCaos);
  62. }
  63.  
  64. #endif /* SASC Pragmas */
  65. #endif /* !_PPCPRAGMA_MISC_H */
  66.